package vwg;

public class AppArguments {

	private String relSrc;

	public String getRelSrc() {
		return relSrc;
	}

	public String getRelTarget() {
		return relTarget;
	}

	public boolean isClassified() {
		return isClassified;
	}

	public boolean isCustomExtractor() {
		return isCustomExtractor;
	}

	public Integer getAttributesCount() {
		return attributesCount;
	}

	private String relTarget;
	private boolean isClassified = false;
	private boolean isCustomExtractor = false;
	private Integer attributesCount = null;

	public void parseArgs(String[] args) throws UnsupportedOperationException{
		if (args.length < 2) {
			throw new UnsupportedOperationException(
					"target and src are not specified");
		}

		relSrc = args[0];
		relTarget = args[1];

		if (args.length > 2) {
			isClassified = Boolean.parseBoolean(args[2]);
		}

		if (args.length > 3) {
			isCustomExtractor = Boolean.parseBoolean(args[3]);
			if (isCustomExtractor && args.length == 4) {
				throw new UnsupportedOperationException(
						"attributesCount is not specified");
			}
			attributesCount = Integer.parseInt(args[4]);
		}

	}

}
